﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Shop.Managers;
using Shop.Mappers;

namespace Shop.Controllers
{
    public class ProductsController : Controller
    {
        private IManagerProduct managerProducts;
        private IWebMapper mapper;

        public ProductsController(IManagerProduct managerProducts, IWebMapper mapper)
        {
            this.managerProducts = managerProducts;
            this.mapper = mapper;
        }

        public ActionResult Index()
        {
            return View(mapper.Wrapper(managerProducts.All.ToList()));
        }

    }
}
